<template>
  <div class="box">
    <h3>Child1 - 接收数据</h3>
  </div>
</template>

<script lang="ts" setup>
import Pubsub from 'pubsub-js'

const receiveData = (type: string, data: str) => {
  console.log(type, data);
}

Pubsub.subscribe('receiveData', receiveData)
</script>
